<template>
    <div id="Detail">
        <div>
            <div class="title">
                <p>个人信息资料</p>
                <span>({{detail.updatedAt | dateMoment("YYYY-MM-DD HH:mm")}})</span>
            </div>
            <div class="phone">
                <div class="tel">
                    <p class="tel_">手机号</p>
                    <p class="number">{{detail.mobile}}</p>
                </div>
            </div>
            <div class="body">
                <div class="body_Detail">
                    <ul>
                        <li class="li">
                            <p class="tel_text">姓名</p>
                            <p class="text">{{detail.name}}</p>
                        </li>
                        <li class="li">
                            <p class="tel_text">性别</p>
                            <p class="text_sex">{{inner}}</p>
                        </li>
                        <li class="li">
                            <p class="tel_store">门&nbsp;&nbsp;&nbsp;店</p>
                            <p class="text">{{detail.store}}</p>
                        </li>
                        <li class="remark">
                            <p class="remark_text">备注</p>
                            <p class="remark_">{{detail.remark}}</p>
                        </li>
    
                    </ul>
                </div>
                <div class="photo">
                    <p>照&nbsp; &nbsp;&nbsp;片</p>
                    <div class="float" v-for="item in detail.imgUrl" :key="item.id">
                        <img v-bind:src="item">
                    </div>
                </div>
            </div>
        </div>
    </div>
</template>

<script>
import moment from 'moment';
export default {
    name: 'form',
    data() {
        return {
            inner: "",
            id: null,
            detail: {}
            // { date: '2017年03月04日', tel: '13000000000', name: '王小二', sex: '女', remark: '上海店消费三次', img: './../../../static/img/phone.png' }


        }
    },
    methods: {
        getDetail: function () {

            this.$http.get('/api/member/memberInfo?id=' + this.id).then(res => {
                // alert(JSON.stringify(res))
                this.detail = res.body;
                if (this.detail.gender == 1) {
                    this.inner = "女"
                } else {
                    this.inner = "男"
                }

                this.detail.imgUrl = JSON.parse(res.body.imgUrl)
                // alert(JSON.stringify(this.detail))


            }, error => {
                // ddapi.toast(error.body);
            })
        },


    },

    created: function () {
        this.id = this.$route.query.id;
        // alert(this.id)
        this.getDetail();
        // this.innerHtml()
    }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
.float {
    display: inline-block;
    width: 32%;

    padding: 0.5rem 0.8rem;
}

.float img {
    width: 6rem;
}

.photo {
    font-size: 1.5rem;
    margin: 1rem 0 0rem 3rem;
}

.photo p {
    margin-bottom: 1rem;
}

.remark_ {
    padding-top: 0.2rem;
    font-size: 1.3rem;
    color: #919090;
    width: 200px;
}

.remark_text {
    padding-top: 0.1rem;
    font-size: 1.5rem;
    margin-right: 17%;
}

.text {
    font-size: 1.3rem;
    color: #919090;
    width: 200px;
}

.text_sex {
    font-size: 1.3rem;
    color: #919090;
    width: 200px;
}

.body {
    background: #fff;
}

.li {
    line-height: 4.4rem;
    height: 4.4rem;
    margin: 0 3rem;
    display: -webkit-box;
    border-bottom: 1px solid #f5f5f5;
}

.remark {
    padding: 1rem 0;
    min-height: 45px;
    margin: 0 3rem;
    display: -webkit-box;
    border-bottom: 1px solid #f5f5f5;
}

.title p {
    color: #BAB8B8;
    padding-left: 1.2rem;
    font-size: 1.2rem;
    margin-right: 1rem;
}

.title span {
    color: #BAB8B8;
    font-size: 1.3rem;
}

.title {
    line-height: 3rem;
    display: -webkit-box;
    height: 3rem;
}

.phone {
    margin-bottom: 1rem;
    background: #fff;
}

.tel {
    margin-left: 3rem;
    display: -webkit-box;
    line-height: 4.4rem;
    height: 4.4rem;
    background: #fff;
    font-size: 1.5rem;
}

.tel_ {
    font-size: 1.5rem;
    margin-right: 10%;
}

.tel_text {
    font-size: 1.5rem;
    margin-right: 17%;
}

.tel_store {
    font-size: 1.5rem;
    margin-right: 14%;
}

.number {
    font-size: 1.3rem;
    color: #919090;
}
</style>
  
